<!--引入共用头部-->
	{{include file="./top.html" assign=b}}
	{{$b}}
	<!--引入js文件-->
	{{js file="./template/index.js"}}
	<!--引入css文件-->
	<!--作业-->
	{{css file='./template/css.css'}}
		<h2 style="color: red;">欢迎使用smarty</h2>
		<table border="2">
			<tr>
				<td>aid</td>
				<td>标题</td>
				<td>内容</td>
				<td>点击次数</td>
			</tr>
			{{section loop=$data name=n}}
				{{if $smarty.section.n.first}}
					<tr style="color:red">
						<td>{{$data[n].did}}</td>
						<td>{{$data[n].title}}</td>
						<td>{{$data[n].content}}</td>
						<td>{{$data[n].click}}</td>
					</tr>
				{{else}}
					<tr>
						<td>{{$data[n].did}}</td>
						<td>{{$data[n].title}}</td>
						<td>{{$data[n].content}}</td>
						<td>{{$data[n].click}}</td>
					</tr>
				{{/if}}
			{{/section}}
		</table>
		<hr />
		<table border="2">
			<tr>
				<td>aid</td>
				<td>标题</td>
				<td>内容</td>
				<td>点击次数</td>
			</tr>
			{{section loop=$data name=n}}
				{{if $smarty.section.n.index<3}}
					<tr style="color:red">
						<td>{{$data[n].did}}</td>
						<td>{{$data[n].title}}</td>
						<td>{{$data[n].content}}</td>
						<td>{{$data[n].click}}</td>
					</tr>
				{{else}}
					<tr>
						<td>{{$data[n].did}}</td>
						<td>{{$data[n].title}}</td>
						<td>{{$data[n].content}}</td>
						<td>{{$data[n].click}}</td>
					</tr>
				{{/if}}
			{{/section}}
		</table>
		
		<hr />
		{{$len|truncate_d}}
		<hr />
		{{$len|truncate_d:20}}<!--20为自己定义截取的字符长度-->
		<hr />
		<!--作业-->
		{{$data1|color:'green'}}
		
	</body>
</html>
